1、编写脚本 createuser.sh,实现如下功能:使用一个用户名作为参数,如果 指定参数的用户存在,就显示其存在,否则添加之;显示添加的用户的id号等信息 read -p " input the user: " USER if id $USER &> /dev/null ; then echo ...
分类:
系统相关 时间:
2021-04-20 14:31:15
阅读次数:
0
Centos8.3-NIS NIS-Server 安装nis相关的软件包 dnf -y install ypserv rpcbind 修改主机名 hostnamectl set-hostname node1.skills.com 设置nis域 ypdomainname skills.com echo ...
分类:
其他好文 时间:
2021-04-20 14:04:05
阅读次数:
0
#! /bin/bash # @author # @breif auto ssh function show_usage(){ echo -e " This is Usage " echo -e " -h: which host to go,for example dev041" } functio ...
分类:
其他好文 时间:
2021-04-19 15:50:26
阅读次数:
0
通过nginx -t获得 nginx=`nginx -t 2>&1 | grep configuration` if [ ! -z "$nginx" ];then nginxtmp="${nginx#*file}" nginxf="${nginxtmp%test*}" echo $nginxf fi ...
分类:
系统相关 时间:
2021-04-19 15:38:16
阅读次数:
0
xargs 作用 xargs作用是将标准输入转为命令行参数。 args单独使用默认后面是echo xargs # 等同于 xargs echo 输入xargs按下回车以后,命令行就会等待用户输入,作为标准输入。可以输入任意内容,直到按下Ctrl + d,表示输入结束,这时echo命令就会把前面的输入 ...
分类:
其他好文 时间:
2021-04-19 15:02:22
阅读次数:
0
树 建树 struct tr{ char x; tr*lc,*rc; }; #define nu NULL // 建树 tr* create() { tr*t ; char x;cin>>x; if(x=='#') { t=nu; }else{ t=new tr; t->x=x; t->lc=nu; ...
分类:
其他好文 时间:
2021-04-19 15:00:42
阅读次数:
0
//本模板是离散后对权值建树 #include<bits/stdc++.h> #define mid (l+r>>1) using namespace std; const int N=2e5+10; struct TR { int sum,lo,ro; }tr[N<<5]; int tr_cnt; ...
分类:
其他好文 时间:
2021-04-15 12:28:09
阅读次数:
0
参考博客:linux下ElasticSearch.6.2.2集群安装与head、Kibana、X-Pack..插件的配置安装 参考博客:ELK5.5.1 插件安装实践纪要(head/bigdesk/kopf/cerebo/中文分词插件) 参考博客:ELK构建MySQL慢日志收集平台详解 参考博客:针 ...
分类:
其他好文 时间:
2021-04-14 12:42:49
阅读次数:
0
vi proc1.sh #!/bin/bash #此脚本期望的参数个数argno=1 if [ $# -ne $argno ]then echo "Usage: 'basename $0' PID-number" >&2fi if [ ! -f "/proc/$1" ]then echo "Proc ...
分类:
系统相关 时间:
2021-04-14 11:51:22
阅读次数:
0
vi file_can_execute_or_not1.sh #!/bin/bash #判断输入的参数个数是否为两个 if [ $# -lt 2 ]then echo "The num of parameter is not right! " exit 0fi #判断用户输入的第一个文件是否可以读i ...
分类:
系统相关 时间:
2021-04-13 12:56:38
阅读次数:
0